public class Teacher {
    // 教师属性
    private String teacherId;    // 教师编号
    private String name;         // 姓名
    private String gender;       // 性别
    private Course course;       // 所授课程（关联课程对象）

    // 构造方法
    public Teacher(String teacherId, String name, String gender) {
        this.teacherId = teacherId;
        this.name = name;
        this.gender = gender;
    }

    // 教师“开课”方法
    public Course openCourse(String courseId, String courseName, String location, String time) {
        this.course = new Course(courseId, courseName, location, time, this);
        return this.course;
    }

    // Getter方法
    public String getTeacherId() {
        return teacherId;
    }

    public String getName() {
        return name;
    }

    public String getGender() {
        return gender;
    }

    public Course getCourse() {
        return course;
    }
}